<template>
  <div class="EmergencyList">
    <div class="flex location-wrap">
      <span class="white">当前位置：</span>
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/EDManagement' }">应急处置</el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/DisasterReporting' }">灾情信息</el-breadcrumb-item>
        <el-breadcrumb-item>灾情信息报送单</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="box">
      <!-- 列表筛选 -->
      <filterTitle @query="query" @reset="reset" :form="form" :formData="formData" labelWidth="140px"
        @node-click="deptChoose" @change="selectChange">
        <!-- <el-form slot="filter" class="form" ref="form" :model="form" inline size="small" label-width="140px">
          <el-form-item :label="item.label + '：'" v-for="(item, index) in formData" :key="index" :rules="rules[item.id]"
            :prop="item.id">
            <LsdForm :compData="item" :form="form" @node-click="deptChoose(arguments, item)"
              @change="selectChange(arguments, item)" />
          </el-form-item>
        </el-form> -->
      </filterTitle>
      <!-- 设备部 列表表格  -->
      <!-- <div v-if="FilledBy.pprovalDeptId === '1533835007333440' || FilledBy.pprovalDeptId === '1533835007333666' || FilledBy.pprovalDeptId === '1533835007333451'">
        <LsdTable slot="gjxm" :paginationAtrrs="paginationAtrrs" :compRef="table.compRef" ref="gjxm" @pageChange="handleSizeChange" :columns="table.columns" :title="table.title" :actions="table.actions" :tableData="table.tableData" :tableAttr="table.tableAttr" :isShowPage="table.isShowPage" :isSelectFlag="table.isSelectFlag" :isSequenceFlag="table.isSequenceFlag" @onActionClick="onActionClick" />
      </div> -->
      <!-- 配电部 列表表格  -->
      <!-- <div v-if="FilledBy.pprovalDeptId === '1533835007333568'">
        <LsdTable slot="gjxm" :paginationAtrrs="paginationAtrrs" :compRef="distributionData.compRef" ref="gjxm" @pageChange="handleSizeChange" :columns="distributionData.columns" :title="distributionData.title" :actions="distributionData.actions" :tableData="distributionData.tableData" :tableAttr="distributionData.tableAttr" :isShowPage="distributionData.isShowPage" :isSelectFlag="distributionData.isSelectFlag" :isSequenceFlag="distributionData.isSequenceFlag" @onActionClick="distributionDataClick" />
      </div> -->
      <!-- 营销部 列表表格  -->
      <!-- <div v-if="FilledBy.pprovalDeptId === '1533835007333504' || FilledBy.pprovalDeptId === '1533835117333666'">
        <LsdTable slot="gjxm" :paginationAtrrs="paginationAtrrs" :compRef="marketingData.compRef" ref="gjxm" @pageChange="handleSizeChange" :columns="marketingData.columns" :title="marketingData.title" :actions="marketingData.actions" :tableData="marketingData.tableData" :tableAttr="marketingData.tableAttr" :isShowPage="marketingData.isShowPage" :isSelectFlag="marketingData.isSelectFlag" :isSequenceFlag="marketingData.isSequenceFlag" @onActionClick="marketingDataDataClick" />
      </div> -->

      <!-- 整合 -->
      <div>
        <LsdTable slot="gjxm" :paginationAtrrs="paginationAtrrs" :compRef="table.compRef" ref="gjxm"
          @pageChange="handleSizeChange" :columns="table.columns" :title="table.title" :actions="table.actions"
          :tableData="table.tableData" :tableAttr="table.tableAttr" :isShowPage="table.isShowPage"
          :isSelectFlag="table.isSelectFlag" :isSequenceFlag="table.isSequenceFlag" @onActionClick="onActionClick" />
      </div>
    </div>
    <!--设备部 弹窗信息 -->
    <LsdDialog :dialogConfig="dialogConfig" @handleBtn="handleBtn" @close="close">
      <LsdDialogTitle slot="dialog" :titleConfig="titleConfig" :activeNames="activeNames">
        <DialogForm ref="formConfigData" slot="slot1" @pickerChange="pickerChange" @changeEvent="handleChange"
          :formConfig="formConfig1" />
        <div slot="slot2">
          <LsdTable slot="rwxx" :autoHeight="tableList.autoHeight" @pickerChange="pickerChange"
            :paginationAtrrs="paginationAtrrs" :compRef="tableList.compRef" ref="gjxm" :columns="tableList.columns"
            :tableData="tableList.tableData" :tableAttr="tableList.tableAttr"
            :isSequenceFlag="tableList.isSequenceFlag" />
          <div>总计：{{ getShudianTableLength }}条</div>
        </div>
        <div slot="slot3">
          <LsdTable slot="rwxx" :autoHeight="tableDataList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableDataList.compRef" ref="gjxm" :columns="tableDataList.columns"
            :tableData="tableDataList.tableData" :tableAttr="tableDataList.tableAttr"
            :isSequenceFlag="tableDataList.isSequenceFlag" />
          <div>总计：{{ getBiandianTableLength }}条</div>
        </div>
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 配电部 弹窗信息 -->
    <LsdDialog :dialogConfig="distributionDialogConfig" @handleBtn="handleBtn0" @close="close1">
      <LsdDialogTitle slot="dialog" :titleConfig="titleDistributionConfig" :activeNames="activeNames">
        <DialogForm ref="formConfigData1" slot="slot1" @changeEvent="handleChange" :formConfig="formConfig2" />
        <div slot="slot2">
          <LsdTable slot="rwxx" :autoHeight="tableDistributionList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableDistributionList.compRef" ref="gjxm" :columns="tableDistributionList.columns"
            :tableData="tableDistributionList.tableData" :tableAttr="tableDistributionList.tableAttr"
            :isSequenceFlag="tableDistributionList.isSequenceFlag" />
          <div>总计：{{ getPeidianTableLength }}条</div>
        </div>
      </LsdDialogTitle>
    </LsdDialog>
    <!--营销部 弹窗信息 -->
    <LsdDialog :dialogConfig="dialogMarketingConfig" @handleBtn="handleBtn1" @close="close2">
      <LsdDialogTitle slot="dialog" :titleConfig="titleMarketingConfig" :activeNames="activeNames">
        <DialogForm ref="formConfigData2" slot="slot1" @changeEvent="handleChange" :formConfig="formConfig3" />
        <div slot="slot2">
          <LsdTable slot="rwxx" :autoHeight="tableMarketingList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableMarketingList.compRef" ref="gjxm" :columns="tableMarketingList.columns"
            :tableData="tableMarketingList.tableData" :tableAttr="tableMarketingList.tableAttr"
            :isSequenceFlag="tableMarketingList.isSequenceFlag" />
          <div>总计：{{ getTaiquTableLength }}条</div>
        </div>
        <div slot="slot3">
          <LsdTable slot="rwxx" :autoHeight="tableMarketingDataList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableMarketingDataList.compRef" ref="gjxm" :columns="tableMarketingDataList.columns"
            :tableData="tableMarketingDataList.tableData" :tableAttr="tableMarketingDataList.tableAttr"
            :isSequenceFlag="tableMarketingDataList.isSequenceFlag" />
          <div>总计：{{ getZyyhTableLength }}条</div>
        </div>
        <div slot="slot4">
          <LsdTable slot="rwxx" :autoHeight="tableMarketingPutong.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableMarketingPutong.compRef" ref="gjxm" :columns="tableMarketingPutong.columns"
            :tableData="tableMarketingPutong.tableData" :tableAttr="tableMarketingPutong.tableAttr"
            :isSequenceFlag="tableMarketingPutong.isSequenceFlag" />
        </div>
      </LsdDialogTitle>
    </LsdDialog>
    <!-- 单位 - 展示全部 -->
    <LsdDialog :dialogConfig="dialogSetOf" @handleBtn="handleBtnOf" @close="closeOf">
      <!--  -->
      <LsdDialogTitle slot="dialog" :titleConfig="titleOf" :activeNames="activeNames">
        <DialogForm ref="formConfigData" slot="slot1" @pickerChange="pickerChange" @changeEvent="handleChange"
          :formConfig="formConfig1" />
        <div slot="slot2">
          <LsdTable slot="rwxx" :autoHeight="tableList.autoHeight" @pickerChange="pickerChange"
            :paginationAtrrs="paginationAtrrs" :compRef="tableList.compRef" ref="gjxm" :columns="tableList.columns"
            :tableData="tableList.tableData" :tableAttr="tableList.tableAttr"
            :isSequenceFlag="tableList.isSequenceFlag" />
          <div>总计：{{ getShudianTableLength }}条</div>
        </div>
        <div slot="slot3">
          <LsdTable slot="rwxx" :autoHeight="tableDataList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableDataList.compRef" ref="gjxm" :columns="tableDataList.columns"
            :tableData="tableDataList.tableData" :tableAttr="tableDataList.tableAttr"
            :isSequenceFlag="tableDataList.isSequenceFlag" />
          <div>总计：{{ getBiandianTableLength }}条</div>
        </div>
        <!--  -->
        <div slot="slot4">
          <LsdTable slot="rwxx" :autoHeight="tableDistributionList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableDistributionList.compRef" ref="gjxm" :columns="tableDistributionList.columns"
            :tableData="tableDistributionList.tableData" :tableAttr="tableDistributionList.tableAttr"
            :isSequenceFlag="tableDistributionList.isSequenceFlag" />
          <div>总计：{{ getPeidianTableLength }}条</div>
        </div>
        <!--  -->
        <div slot="slot5">
          <LsdTable slot="rwxx" :autoHeight="tableMarketingList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableMarketingList.compRef" ref="gjxm" :columns="tableMarketingList.columns"
            :tableData="tableMarketingList.tableData" :tableAttr="tableMarketingList.tableAttr"
            :isSequenceFlag="tableMarketingList.isSequenceFlag" />
          <div>总计：{{ getTaiquTableLength }}条</div>
        </div>
        <div slot="slot6">
          <LsdTable slot="rwxx" :autoHeight="tableMarketingDataList.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableMarketingDataList.compRef" ref="gjxm" :columns="tableMarketingDataList.columns"
            :tableData="tableMarketingDataList.tableData" :tableAttr="tableMarketingDataList.tableAttr"
            :isSequenceFlag="tableMarketingDataList.isSequenceFlag" />
          <div>总计：{{ getZyyhTableLength }}条</div>
        </div>
        <!-- 普通用户 -->
        <div slot="slot7">
          <LsdTable slot="rwxx" :autoHeight="tableMarketingPutong.autoHeight" :paginationAtrrs="paginationAtrrs"
            :compRef="tableMarketingPutong.compRef" ref="gjxm" :columns="tableMarketingPutong.columns"
            :tableData="tableMarketingPutong.tableData" :tableAttr="tableMarketingPutong.tableAttr"
            :isSequenceFlag="tableMarketingPutong.isSequenceFlag" />
        </div>
      </LsdDialogTitle>
    </LsdDialog>
  </div>
</template>

<script>
import { zqxxbsListData, getYjsjGetById, getResubmitDetailData, zqxxbsSubmit, SaveUpdById, getCircuitData, getCircuitDetailData } from "@/api/EmergencyDisposal/zqbs.js";
// 公共组件接口
import { getDictByGroupEmergency, getSubclassUntilList } from "@/api/common.js";
// import { getHomePageEventTree } from "@/api/EmergencyDisposal/yjsj.js";

import { showTime } from "@/lib";
export default {
  name: "DisasterReportTransmission",
  components: {},
  data() {
    return {
      xinzengNum: 0,
      // tableSelectNum: "1", // 部门
      SbxlOption: [],
      BdzlOption: [], // 变电站
      PdlOption: [], // 配电
      TqOption: [], // 台区
      ZykhOption: [], // 重要客户
      PtyhOption: [], // 普通用户
      reportId: "",
      startPickerOptions: {
        disabledDate(time) {
          return time.getTime() + 86400000 > Date.now();
        }
      },
      // 筛选信息
      formData: [
        {
          elType: "input",
          id: "emergencyEvent",
          label: "应急事件",
          attrs: {
            value: "",
            size: "small",
            "collapse-tags": true,
            clearable: true
          }
        },
        {
          elType: "select",
          id: "eventCode",
          label: "事件类别",
          dic: "dic_sjlb",
          attrs: {
            value: "",
            size: "small",
            filterable: true,
            "collapse-tags": true,
            clearable: true
          },
          options: []
        },
        {
          elType: "select",
          id: "eventLvCode",
          label: "事件级别",
          dic: "dic_sjjb",
          attrs: {
            value: "",
            size: "small",
            filterable: true,
            "collapse-tags": true,
            clearable: true
          },
          options: this.banzuData
        },
        {
          elType: "dateTimePicker",
          id: "occurrenceTime",
          label: "发生时间",
          attrs: {
            value: "",
            size: "small",
            type: "datetimerange",
            "value-format": "yyyy-MM-dd HH:mm:ss",
            clearable: true
          }
        },
        {
          elType: "selectTree",
          id: "unitName1",
          name: "unitId1",
          label: "报送单位",
          attrs: {
            value: "",
            clearable: true,
            "collapse-tags": true
          },
          options: {
            attrs: {
              value: ""
            }
          },
          treeData: {
            attrs: {
              data: []
            },
            props: {
              children: "children",
              label: "orgName",
              value: "id"
            }
          }
        },
        {
          elType: "select",
          id: "taskName",
          label: "报送部门",
          // dic: "dic_xxly",
          dic: "dic_zrbm",
          attrs: {
            value: "",
            size: "small",
            // clearable: true,
            filterable: true,
            "collapse-tags": true,
            clearable: true
          },
          options: this.dishiData
        },
        {
          elType: "dateTimePicker",
          id: "issueTime",
          label: "报送时间",
          attrs: {
            value: "",
            size: "small",
            type: "datetimerange",
            "value-format": "yyyy-MM-dd HH:mm:ss",
            clearable: true
          }
        }
      ],
      //  表格信息
      table: {
        isSelectFlag: false,
        compRef: "gjxm",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        title: "灾情信息报送单列表",
        actions: [{}],
        tableData: [],
        columns: [
          {
            prop: "emergencyEvent",
            label: "应急事件",
            align: "left",
            "min-width": "230px",
            render: (h, { row }) => {
              return (
                <div>
                  {
                    <span
                      style='color:#3561fd;cursor:pointer;text-decoration: underline;'
                      {...{
                        on: {
                          click: () => {
                            this.handleEmergencyEvents(row);
                          }
                        }
                      }}
                    >
                      {row.emergencyEvent}
                    </span>
                  }
                </div>
              );
            }
          },
          {
            prop: "eventName",
            label: "事件类别",
            align: "center",
            "min-width": "120px"
          },
          {
            prop: "eventLvName",
            label: "事件级别",
            align: "center",
            "min-width": "120px"
          },
          {
            prop: "effectRange",
            label: "影响范围",
            align: "center",
            "min-width": "120px"
          },
          {
            prop: "occurrenceTime",
            label: "发生时间",
            align: "center",
            "min-width": "110px"
          },
          {
            prop: "reportUnit",
            label: "报送单位",
            align: "center",
            "min-width": "120px"
          },
          {
            prop: "creatorDeptName",
            label: "报送部门",
            align: "center",
            "min-width": "120px"
          },
          {
            prop: "createTime",
            label: "报送时间",
            align: "center",
            "min-width": "110px"
          },
          {
            prop: "",
            label: "输电线路",
            align: "center",
            // "min-width": "100px",
            children: [
              {
                prop: "",
                label: "500kV及以上",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.sdxl500KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.sdxl500KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              },
              {
                label: "220kV",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.sdxl220KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.sdxl220KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              },
              {
                label: "110kV",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.sdxl110KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.sdxl110KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              },
              {
                label: "35kV",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.sdxl35KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.sdxl35KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              }
            ]
          },
          {
            label: "变电站",
            align: "center",
            // "min-width": "100px",
            children: [
              {
                label: "500kV及以上",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.bdz500KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.bdz500KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              },
              {
                label: "220kV",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.bdz220KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.bdz220KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              },
              {
                label: "110kV",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.bdz110KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.bdz110KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              },
              {
                label: "35kV",
                align: "center",
                // "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.bdz35KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "100px"
                  },
                  {
                    prop: "statisticInfo.bdz35KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "100px"
                  }
                ]
              }
            ]
          },
          // 配电线路
          {
            prop: "",
            label: "配电线路",
            align: "center",
            "min-width": "100px",
            children: [
              {
                prop: "",
                label: "10kV",
                align: "center",
                "min-width": "120px",
                children: [
                  {
                    prop: "statisticInfo.pdxl10KvTrip",
                    label: "累计跳闸",
                    align: "center",
                    "min-width": "120px"
                  },
                  {
                    prop: "statisticInfo.pdxl10KvRecover",
                    label: "累计恢复",
                    align: "center",
                    "min-width": "120px"
                  }
                ]
              }
            ]
          },
          // 台区
          {
            prop: "",
            label: "台区",
            align: "center",
            // "min-width": "100px",
            children: [
              {
                prop: "statisticInfo.tqTrip",
                label: "累计停电",
                align: "center",
                "min-width": "100px"
              },
              {
                prop: "statisticInfo.tqRecover",
                label: "累计恢复",
                align: "center",
                "min-width": "100px"
              },
              {
                prop: "statisticInfo.tqRater",
                label: "恢复率",
                align: "center",
                "min-width": "100px"
              }
            ]
          },
          // 用户
          {
            prop: "",
            label: "用户",
            align: "center",
            // "min-width": "100px",
            children: [
              {
                prop: "statisticInfo.ptyhTrip",
                label: "累计停电",
                align: "center",
                "min-width": "100px"
              },
              {
                prop: "statisticInfo.ptyhRecover",
                label: "累计恢复",
                align: "center",
                "min-width": "100px"
              },
              {
                prop: "statisticInfo.ptyhRater",
                label: "恢复率",
                align: "center",
                "min-width": "100px"
              }
            ]
          },
          // 重要用户
          {
            prop: "",
            label: "重要用户",
            align: "center",
            // "min-width": "100px",
            children: [
              {
                prop: "statisticInfo.zyyhTrip",
                label: "累计停电",
                align: "center",
                "min-width": "100px"
              },
              {
                prop: "statisticInfo.zyyhRecover",
                label: "累计恢复",
                align: "center",
                "min-width": "100px"
              },
              {
                prop: "statisticInfo.zyyhRater",
                label: "恢复率",
                align: "center",
                "min-width": "100px"
              }
            ]
          },
          {
            prop: "cz",
            label: "操作",
            align: "center",
            fixed: "right",
            // "min-width": "100px",
            render: (h, { row }) => {
              // console.log(row)
              // {row.writeState === "0" && JSON.parse(sessionStorage.getItem("account")).id != "1530637030785057" ? "填报" : ""}
              return (
                <div>
                  {
                    <span
                      // style={{ color: row.orgType == "2" && this.FilledBy.roleName.indexOf("设备") != -1 && row.creatorDeptName.indexOf("设备") != -1 || this.FilledBy.roleName.indexOf("配电") != -1 && row.creatorDeptName.indexOf("配电") != -1 || this.FilledBy.roleName.indexOf("营销") != -1 && row.creatorDeptName.indexOf("营销") != -1 ? "#3561fd" : "#AAAAAA" }}
                      style={{ color: row.orgType == "2" && this.FilledBy.roleName.indexOf("设备") != -1 && row.creatorDeptName.indexOf("设备") != -1 || this.FilledBy.roleName.indexOf("配电") != -1 && row.creatorDeptName.indexOf("配电") != -1 || this.FilledBy.roleName.indexOf("营销") != -1 && row.creatorDeptName.indexOf("营销") != -1 ? "#3561fd" : "#3561fd" }}
                      {...{
                        on: {
                          click: () => {
                            this.writeReport(row);
                          }
                        }
                      }}
                    >
                      {row.writeState === "0" ? "填报" : ""}
                    </span>

                  }
                  {
                    < span
                      style={{ color: row.orgType == "2" && this.FilledBy.roleName.indexOf("设备") != -1 && row.creatorDeptName.indexOf("设备") != -1 || this.FilledBy.roleName.indexOf("配电") != -1 && row.creatorDeptName.indexOf("配电") != -1 || this.FilledBy.roleName.indexOf("营销") != -1 && row.creatorDeptName.indexOf("营销") != -1 ? "#AAAAAA" : "#AAAAAA" }}
                      {...{
                        on: {
                          click: () => {
                            this.writeResubmit(row);
                          }
                        }
                      }
                      }
                    >
                      {row.writeState === "1" ? "续报" : ""}
                    </span >
                  }
                </div>
              );
            }
          }
        ],
        tableAttr: {
          // "min-height": "430px",
          // height: "430px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      shows: true,
      tableList: {
        isSelectFlag: true,
        compRef: "rwxx",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        autoHeight: true,
        title: "灾情信息报送单列表",
        actions: [
        ],
        tableData: [
          {
            lineName: "",
            lineCode: "",
            blackoutTime: "",
            recoverTime: "", // 复电时间
            tripCause: "",
            voltageClasses: "",
            unitName: "",
            unitId: ""
          }
        ],
        columns: [
          {
            label: "停运输电线路名称",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "select",
                      name: "lineName",
                      id: "lineCode",
                      label: "停运输电线路名称",
                      // dic: "dic_zrbm",
                      attrs: {
                        value: "",
                        clearable: true,
                        filterable: true,
                        disabled: false,
                        multiple: false,
                        "collapse-tags": true
                      },
                      options: this.SbxlOption

                    }}
                    form={row}
                    {...{
                      on: {
                        change: (item) => {
                          console.log(item);
                          this.aaaClick(item, row);
                        }
                      }
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },

          {
            prop: "unitName",
            id: "unitId",
            label: "所属单位",
            align: "left",
            "min-width": "120px"
          },
          {
            prop: "voltageClasses",
            label: "电压等级",
            align: "center",
            "min-width": "70px"
          },
          {
            // prop: "taskContent",
            label: "停运/跳闸原因",
            align: "left",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "input",
                      id: "tripCause",
                      label: "停运/跳闸原因",
                      attrs: {
                        // disabled:
                        //   _this.operat === "review" ||
                        //   !["task999"].includes(_this.$route.query.task) ||
                        //   ["task2", "task3"].includes(
                        //     _this.$route.query.returnFlow
                        //   ),
                        disabled: false,
                        clearable: true,
                        value: "",
                        placeholder: "请输入",
                        min: 0,
                        type: "text"
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "停电时间",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "blackoutTime",
                      label: "停电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss",
                        "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "复电时间",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "recoverTime",
                      label: "复电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss"
                        // "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },

          {
            prop: "cz",
            label: "操作",
            align: "center",
            fixed: "right",
            "min-width": "50px",
            render: (h, { $index }) => {
              return (
                <div>
                  {
                    $index === this.tableList.tableData.length - 1 && (
                      <img
                        {...{
                          class: {},
                          style: {
                            width: "16px",
                            height: "16px",
                            "margin-right": "10px"
                          },
                          attrs: {
                            src: require("../../../assets/img/listAdd.png")
                          },
                          on: {
                            click: (scope) => {
                              this.$nextTick(() => {
                                this.tableList.tableData.push(
                                  {
                                    lineName: "",
                                    lineCode: "",
                                    blackoutTime: "",
                                    recoverTime: "", // 复电时间
                                    tripCause: "",
                                    voltageClasses: "",
                                    unitName: "",
                                    unitId: ""
                                  }
                                );
                              });
                            }
                          }
                        }}
                      />
                    )
                  }
                  {this.tableList.tableData.length > 1 && (
                    <img
                      {...{
                        class: {},
                        style: {
                          width: "16px",
                          height: "16px",
                          cursor: "pointer"
                        },
                        attrs: {
                          src: require("../../../assets/img/listReduc.png")
                        },
                        on: {
                          click: () => {
                            this.tableList.tableData.splice($index, 1);
                          }
                        }
                      }}
                    />)}
                </div>
              );
            }
          }
        ],
        tableAttr: {
          // "min-height": "470px",
          // height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      tableDataList: {
        isSelectFlag: true,
        compRef: "rwxx",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        autoHeight: true,
        title: "灾情信息报送单列表",
        actions: [
        ],
        tableData: [
          {
            lineName: "",
            lineCode: "",
            blackoutTime: "",
            recoverTime: "", // 复电时间
            tripCause: "",
            voltageClasses: "",
            unitName: "",
            unitId: ""
          }
        ],
        columns: [
          {
            // prop: "dutyDeptId",
            label: "停运变电站名称",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "select",
                      name: "lineName",
                      id: "lineCode",
                      label: "停运变电站名称",
                      // dic: "dic_zrbm",
                      attrs: {
                        value: "",
                        clearable: true,
                        filterable: true,
                        disabled: false,
                        multiple: false,
                        "collapse-tags": true
                      },
                      options: this.BdzlOption

                    }}
                    form={row}
                    {...{
                      on: {
                        change: (item) => {
                          console.log(item);
                          this.bbbClick(item, row);
                        }
                      }
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "unitName",
            id: "unitId",
            label: "所属单位",
            align: "left",
            "min-width": "120px"
          },
          {
            prop: "voltageClasses",
            label: "电压等级",
            align: "center",
            "min-width": "70px"
          },
          {
            // prop: "taskContent",
            label: "停运/跳闸原因",
            align: "left",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "input",
                      id: "tripCause",
                      label: "停运/跳闸原因",
                      attrs: {
                        // disabled:
                        //   _this.operat === "review" ||
                        //   !["task999"].includes(_this.$route.query.task) ||
                        //   ["task2", "task3"].includes(
                        //     _this.$route.query.returnFlow
                        //   ),
                        disabled: false,
                        clearable: true,
                        value: "",
                        placeholder: "请输入",
                        min: 0,
                        type: "text"
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "停电时间",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "blackoutTime",
                      label: "停电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss",
                        "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "复电时间",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "recoverTime",
                      label: "复电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss"
                        // "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "cz",
            label: "操作",
            align: "center",
            fixed: "right",
            "min-width": "50px",
            render: (h, { $index }) => {
              return (
                <div>
                  {
                    $index === this.tableDataList.tableData.length - 1 && (
                      <img
                        {...{
                          class: {},
                          style: {
                            width: "16px",
                            height: "16px",
                            "margin-right": "10px"
                          },
                          attrs: {
                            src: require("../../../assets/img/listAdd.png")
                          },
                          on: {
                            click: (scope) => {
                              this.$nextTick(() => {
                                this.tableDataList.tableData.push(
                                  {
                                    lineName: "",
                                    lineCode: "",
                                    blackoutTime: "",
                                    recoverTime: "", // 复电时间
                                    tripCause: "",
                                    voltageClasses: "",
                                    unitName: "",
                                    unitId: ""
                                  }
                                );
                              });
                            }
                          }
                        }}
                      />
                    )
                  }
                  {this.tableDataList.tableData.length > 1 && (
                    <img
                      {...{
                        class: {},
                        style: {
                          width: "16px",
                          height: "16px",
                          cursor: "pointer"
                        },
                        attrs: {
                          src: require("../../../assets/img/listReduc.png")
                        },
                        on: {
                          click: () => {
                            this.tableDataList.tableData.splice($index, 1);
                          }
                        }
                      }}
                    />)}
                </div>
              );
            }
          }
        ],
        tableAttr: {
          // "min-height": "470px",
          // height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      // 配电 弹窗
      tableDistributionList: {
        isSelectFlag: true,
        compRef: "rwxx",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        autoHeight: true,
        title: "灾情信息报送单列表",
        actions: [
        ],
        tableData: [
          {
            lineName: "",
            lineCode: "",
            blackoutTime: "",
            recoverTime: "", // 复电时间
            tripCause: "",
            voltageClasses: "",
            unitName: "",
            unitId: ""
          }
        ],
        columns: [
          {
            // prop: "dutyDeptId",
            label: "停运配电线路名称",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "select",
                      name: "lineName",
                      id: "lineCode",
                      label: "停运配电线路名称",
                      attrs: {
                        value: "",
                        clearable: true,
                        filterable: true,
                        disabled: false,
                        multiple: false,
                        "collapse-tags": true
                      },
                      options: this.PdlOption

                    }}
                    form={row}
                    {...{
                      on: {
                        change: (item) => {
                          console.log(item);
                          this.PdClick(item, row);
                        }
                      }
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "unitName",
            id: "unitId",
            label: "所属单位",
            align: "left",
            "min-width": "120px"
          },
          {
            prop: "voltageClasses",
            label: "电压等级",
            align: "center",
            "min-width": "70px"
          },
          {
            // prop: "taskContent",
            label: "停运/跳闸原因",
            align: "left",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "input",
                      id: "tripCause",
                      label: "停运/跳闸原因",
                      attrs: {
                        // disabled:
                        //   _this.operat === "review" ||
                        //   !["task999"].includes(_this.$route.query.task) ||
                        //   ["task2", "task3"].includes(
                        //     _this.$route.query.returnFlow
                        //   ),
                        disabled: false,
                        clearable: true,
                        value: "",
                        placeholder: "请输入",
                        min: 0,
                        type: "text"
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "停电时间",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "blackoutTime",
                      label: "停电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss",
                        "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "复电时间",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "recoverTime",
                      label: "复电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss"
                        // "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "cz",
            label: "操作",
            align: "center",
            fixed: "right",
            "min-width": "50px",
            render: (h, { $index }) => {
              return (
                <div>
                  {
                    $index === this.tableDistributionList.tableData.length - 1 && (
                      <img
                        {...{
                          class: {},
                          style: {
                            width: "16px",
                            height: "16px",
                            "margin-right": "10px"
                          },
                          attrs: {
                            src: require("../../../assets/img/listAdd.png")
                          },
                          on: {
                            click: (scope) => {
                              this.$nextTick(() => {
                                this.tableDistributionList.tableData.push(
                                  {
                                    lineName: "",
                                    lineCode: "",
                                    blackoutTime: "",
                                    recoverTime: "", // 复电时间
                                    tripCause: "",
                                    voltageClasses: "",
                                    unitName: "",
                                    unitId: ""
                                  }
                                );
                              });
                            }
                          }
                        }}
                      />
                    )
                  }
                  {this.tableDistributionList.tableData.length > 1 && (
                    <img
                      {...{
                        class: {},
                        style: {
                          width: "16px",
                          height: "16px",
                          cursor: "pointer"
                        },
                        attrs: {
                          src: require("../../../assets/img/listReduc.png")
                        },
                        on: {
                          click: () => {
                            this.tableDistributionList.tableData.splice($index, 1);
                          }
                        }
                      }}
                    />)}
                </div>
              );
            }
          }
        ],
        tableAttr: {
          // "min-height": "470px",
          // height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      // 营销部 弹窗数据1
      tableMarketingList: {
        isSelectFlag: true,
        compRef: "rwxx",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        autoHeight: true,
        title: "灾情信息报送单列表",
        actions: [
        ],
        tableData: [
          {
            lineName: "",
            lineCode: "",
            blackoutTime: "",
            recoverTime: "", // 复电时间
            location: "",
            unitName: "",
            unitId: ""
          }
        ],
        columns: [
          {
            // prop: "dutyDeptId",
            label: "停运台区名称",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "select",
                      name: "lineName",
                      id: "lineCode",
                      label: "停运台区名称",
                      // dic: "dic_zrbm",
                      attrs: {
                        value: "",
                        clearable: true,
                        filterable: true,
                        disabled: false,
                        multiple: false,
                        "collapse-tags": true
                      },
                      options: this.TqOption

                    }}
                    form={row}
                    {...{
                      on: {
                        change: (item) => {
                          console.log(item);
                          this.TqClick(item, row);
                        }
                      }
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "unitName",
            id: "unitId",
            label: "所属单位",
            align: "left",
            "min-width": "120px"
          },
          {
            prop: "location",
            label: "位置",
            align: "left",
            "min-width": "70px"
          },
          {
            // prop: "taskContent",
            label: "停电时间",
            align: "left",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "blackoutTime",
                      label: "停电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss",
                        "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "复电时间",
            align: "left",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "recoverTime",
                      label: "复电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss"
                        // "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          //   {
          //   elType: "dateTimePicker",
          //   id: "occurrenceTime",
          //   label: "发生时间",
          //   attrs: {
          //     value: "",
          //     size: "small",
          //     type: "datetime",
          //     "value-format": "yyyy-MM-dd HH:mm:ss"
          //   }
          // },
          {
            prop: "cz",
            label: "操作",
            align: "center",
            fixed: "right",
            "min-width": "50px",
            render: (h, { $index }) => {
              return (
                <div>
                  {
                    $index === this.tableMarketingList.tableData.length - 1 && (
                      <img
                        {...{
                          class: {},
                          style: {
                            width: "16px",
                            height: "16px",
                            "margin-right": "10px"
                          },
                          attrs: {
                            src: require("../../../assets/img/listAdd.png")
                          },
                          on: {
                            click: (scope) => {
                              this.$nextTick(() => {
                                this.tableMarketingList.tableData.push(
                                  {
                                    lineName: "",
                                    lineCode: "",
                                    blackoutTime: "",
                                    recoverTime: "", // 复电时间
                                    tripCause: "",
                                    voltageClasses: "",
                                    unitName: "",
                                    unitId: ""
                                  }
                                );
                              });
                            }
                          }
                        }}
                      />
                    )
                  }
                  {this.tableMarketingList.tableData.length > 1 && (
                    <img
                      {...{
                        class: {},
                        style: {
                          width: "16px",
                          height: "16px",
                          cursor: "pointer"
                        },
                        attrs: {
                          src: require("../../../assets/img/listReduc.png")
                        },
                        on: {
                          click: () => {
                            this.tableMarketingList.tableData.splice($index, 1);
                          }
                        }
                      }}
                    />)}
                </div>
              );
            }
          }
        ],
        tableAttr: {
          // "min-height": "470px",
          // height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      // 营销部 弹窗数据 2
      tableMarketingDataList: {
        isSelectFlag: true,
        compRef: "rwxx",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        autoHeight: true,
        title: "灾情信息报送单列表",
        actions: [
        ],
        tableData: [
          {
            lineName: "",
            lineCode: "",
            blackoutTime: "",
            recoverTime: "", // 复电时间
            location: "",
            unitName: "",
            unitId: "",
            grade: ""
          }
        ],
        columns: [
          {
            // prop: "dutyDeptId",
            label: "停电重要客户",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "select",
                      name: "lineName",
                      id: "lineCode",
                      label: "停电重要客户",
                      // dic: "dic_zrbm",
                      attrs: {
                        value: "",
                        clearable: true,
                        filterable: true,
                        disabled: false,
                        multiple: false,
                        "collapse-tags": true
                      },
                      options: this.ZykhOption

                    }}
                    form={row}
                    {...{
                      on: {
                        change: (item) => {
                          console.log(item);
                          this.ZykhClick(item, row);
                        }
                      }
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "grade",
            label: "客户等级",
            align: "center",
            "min-width": "70px"
          },
          {
            prop: "unitName",
            label: "所属单位",
            id: "unitId",
            align: "left",
            "min-width": "120px"
          },
          {
            prop: "location",
            label: "位置",
            align: "left",
            "min-width": "120px"
          },
          {
            // prop: "taskContent",
            label: "停电时间",
            align: "left",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "blackoutTime",
                      label: "停电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss",
                        "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "复电时间",
            align: "left",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "dateTimePicker",
                      id: "recoverTime",
                      label: "复电时间",
                      attrs: {
                        value: "",
                        size: "small",
                        type: "datetime",
                        "value-format": "yyyy-MM-dd HH:mm:ss"
                        // "picker-options": this.startPickerOptions
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "cz",
            label: "操作",
            align: "center",
            fixed: "right",
            "min-width": "50px",
            render: (h, { $index }) => {
              return (
                <div>
                  {
                    $index === this.tableMarketingDataList.tableData.length - 1 && (
                      <img
                        {...{
                          class: {},
                          style: {
                            width: "16px",
                            height: "16px",
                            "margin-right": "10px"
                          },
                          attrs: {
                            src: require("../../../assets/img/listAdd.png")
                          },
                          on: {
                            click: (scope) => {
                              this.$nextTick(() => {
                                this.tableMarketingDataList.tableData.push(
                                  {
                                    lineName: "",
                                    lineCode: "",
                                    blackoutTime: "",
                                    recoverTime: "", // 复电时间
                                    tripCause: "",
                                    voltageClasses: "",
                                    unitName: "",
                                    unitId: ""
                                  }
                                );
                              });
                            }
                          }
                        }}
                      />
                    )
                  }
                  {this.tableMarketingDataList.tableData.length > 1 && (
                    <img
                      {...{
                        class: {},
                        style: {
                          width: "16px",
                          height: "16px",
                          cursor: "pointer"
                        },
                        attrs: {
                          src: require("../../../assets/img/listReduc.png")
                        },
                        on: {
                          click: () => {
                            this.tableMarketingDataList.tableData.splice($index, 1);
                          }
                        }
                      }}
                    />)}
                </div>
              );
            }
          }
        ],
        tableAttr: {
          // "min-height": "470px",
          // height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      // 营销部 弹窗数据 3
      tableMarketingPutong: {
        isSelectFlag: true,
        compRef: "rwxx",
        isSequenceFlag: true,
        isShowPage: true,
        resetFlag: true,
        loading: false,
        autoHeight: true,
        title: "灾情信息报送单列表",
        actions: [
        ],
        tableData: [
          {
            blackoutCount: "",
            recoverCount: ""
            // recoverRatio: ""
          }
        ],
        columns: [
          {
            // prop: "taskContent",
            label: "停电数量",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "input",
                      id: "blackoutCount",
                      label: "停电数量",
                      attrs: {
                        value: "",
                        size: "small"
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            // prop: "taskContent",
            label: "恢复供电数量",
            align: "center",
            "min-width": "180px",
            render: (h, { row }) => {
              return (
                <div class='peizhi'>
                  <LsdForm
                    compData={{
                      elType: "input",
                      id: "recoverCount",
                      label: "恢复供电数量",
                      attrs: {
                        value: "",
                        size: "small"
                      }
                    }}
                    form={row}
                    {...{
                      on: {}
                    }}
                  ></LsdForm>
                </div>
              );
            }
          },
          {
            prop: "recoverRatio",
            label: "恢复率",
            align: "center",
            "min-width": "180px"
            // render: (h, { row }) => {
            //   return (
            //     <div class='peizhi'>
            //       <LsdForm
            //         compData={{
            //           elType: "input",
            //           id: "recoverRatio",
            //           label: "恢复率",
            //           attrs: {
            //             value: "",
            //             size: "small"
            //             // type: "datetime",
            //             // "value-format": "yyyy-MM-dd HH:mm:ss"
            //           }
            //         }}
            //         form={row}
            //         {...{
            //           on: {}
            //         }}
            //       ></LsdForm>
            //     </div>
            //   );
            // }
          }
        ],
        tableAttr: {
          // "min-height": "470px",
          // height: "470px",
          stripe: false,
          border: true,
          fit: true,
          "show-header": true,
          "highlight-current-row": true,
          "cell-style": {
            "font-size": "16px"
          },
          "header-cell-style": {
            "text-align": "center",
            "background-color": "#B1C8F9",
            border: "1px solid #ccc",
            "font-size": "16px"
          }
        }
      },
      // paginationAtrrs: {
      //   total: 0,
      //   layout: "total, sizes, prev, pager, next, jumper",
      //   "current-page": 1,
      //   "page-size": 10,
      //   "page-sizes": [10, 20, 30, 40, 50, 100]
      // },
      paginationAtrrs: {
        total: 0,
        "background": true,
        layout: "prev, pager, next",
        "current-page": 1,
        "page-size": 10
      },
      activeNames: ["1", "2", "3", "4", "5", "6", "7"],
      form: {},
      pageNum: 1,
      multipleSelection: [],
      // 设备部 弹窗信息
      dialogConfig: {
        title: "灾情信息报送单",
        isShow: false,
        btnList: [
          {
            name: "提交",
            id: "BSubmitSb", // 事件名
            type: "primary",
            size: "small"
          },
          // {
          //   name: "保存",
          //   id: "BSave", // 事件名
          //   size: "small"
          // },
          {
            name: "取消",
            id: "getBack", // 事件名
            size: "small"
          }
        ]
      },
      // 配电部 弹窗信息
      distributionDialogConfig: {
        title: "灾情信息报送单",
        isShow: false,
        btnList: [
          {
            name: "提交",
            id: "BSubmitPd", // 事件名
            type: "primary",
            size: "small"
          },
          // {
          //   name: "保存",
          //   id: "BSave", // 事件名
          //   size: "small"
          // },
          {
            name: "取消",
            id: "getBack1", // 事件名
            size: "small"
          }
        ]
      },
      // 营销部 弹窗信息
      dialogMarketingConfig: {
        title: "灾情信息报送单",
        isShow: false,
        btnList: [
          {
            name: "提交",
            id: "BSubmitYx", // 事件名
            type: "primary",
            size: "small"
          },
          // {
          //   name: "保存",
          //   id: "BSave", // 事件名
          //   size: "small"
          // },
          {
            name: "取消",
            id: "getBack2", // 事件名
            size: "small"
          }
        ]
      },
      // 单位显示全部
      dialogSetOf: {
        title: "灾情信息报送单",
        isShow: false,
        btnList: [
          {
            name: "提交",
            id: "BSubmitOf", // 事件名
            type: "primary",
            size: "small"
          },
          // {
          //   name: "保存",
          //   id: "BSave", // 事件名
          //   size: "small"
          // },
          {
            name: "取消",
            id: "getBackOf", // 事件名
            size: "small"
          }
        ]
      },
      titleOf: [
        {
          title: "填报人信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "输电线路",
          name: "2",
          slot: "slot2"
        },
        {
          title: "变电站",
          name: "3",
          slot: "slot3"
        },
        {
          title: "配电线路",
          name: "4",
          slot: "slot4"
        },
        {
          title: "台区",
          name: "5",
          slot: "slot5"
        },
        {
          title: "主要用户",
          name: "6",
          slot: "slot6"
        },
        {
          title: "普通用户",
          name: "7",
          slot: "slot7"
        }
      ],
      // 设备部 折叠面板信息
      titleConfig: [
        {
          title: "填报人信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "输电线路",
          name: "2",
          slot: "slot2"
        },
        {
          title: "变电站",
          name: "3",
          slot: "slot3"
        }
      ],
      // 配电部 折叠面板信息
      titleDistributionConfig: [
        {
          title: "填报人信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "配电线路",
          name: "2",
          slot: "slot2"
        }
      ],
      // 营销部 折叠面板信息
      titleMarketingConfig: [
        {
          title: "填报人信息",
          name: "1",
          slot: "slot1"
        },
        {
          title: "台区",
          name: "2",
          slot: "slot2"
        },
        {
          title: "重要用户",
          name: "3",
          slot: "slot3"
        },
        {
          title: "普通用户",
          name: "4",
          slot: "slot4"
        }
      ],
      formConfig: {
        formData: [
          {
            type: "select",
            label: "信息来源",
            prop: "yjtzd",
            class: "half",
            lableWidth: "100px"
          },
          {
            type: "select",
            label: "响应命令单",
            prop: "yjtszd",
            class: "half",
            lableWidth: "100px"
          }
        ],
        rules: {
          yjtzd: [
            { required: true, message: "请选择响应命令单", trigger: "blur" }
          ]
        }
      },
      formConfig1: {
        // disabled: true,
        formData: [
          {
            type: "input",
            label: "报送单位",
            prop: "baosongUnit", // reportUnit
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "报送部门",
            prop: "reportUnit",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "填报人",
            prop: "roleName",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "dataPicker",
            label: "填报时间",
            prop: "createTime",
            class: "half",
            dateType: "datetime",
            isDisabled: true,
            lableWidth: "100px"
          }
        ],
        rules: {
        }
      },
      formConfig2: {
        // disabled: true,
        formData: [
          {
            type: "input",
            label: "报送单位",
            prop: "baosongUnit",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "报送部门",
            prop: "reportUnit",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "填报人",
            prop: "roleName",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "dataPicker",
            label: "填报时间",
            prop: "createTime",
            class: "half",
            dateType: "datetime",
            isDisabled: true,
            lableWidth: "100px"
          }
        ],
        rules: {
        }
      },
      formConfig3: {
        // disabled: true,
        formData: [
          {
            type: "input",
            label: "报送单位",
            prop: "baosongUnit",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "报送部门",
            prop: "reportUnit",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "input",
            label: "填报人",
            prop: "roleName",
            class: "half",
            isDisabled: true,
            lableWidth: "100px"
          },
          {
            type: "dataPicker",
            label: "填报时间",
            prop: "createTime",
            class: "half",
            dateType: "datetime",
            isDisabled: true,
            lableWidth: "100px"
          }
        ],
        rules: {
        }
      },
      formInfoData: {
        disabled: true,
        formData: [
          {
            type: "input",
            label: "下发人",
            prop: "creator",
            class: "third",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "单位及部门",
            prop: "createDeptName",
            class: "third",
            lableWidth: "120px"
          },
          {
            type: "input",
            label: "下发时间",
            prop: "createTime",
            class: "third",
            lableWidth: "120px"
          }
        ]

      },

      rules: {
        name: [
          { required: true, message: "请输入预警信息名称", trigger: "blur" }
        ]
      },
      options: {
        dic_sjlb: [],
        dic_sjjb: [],
        dic_yxfw: [],
        dic_xxly: [],
        dic_zrbm: []
      },
      editId: "", // 编辑id
      sessionStorageData: {}, // 本地存储数据
      sessionStorageData1: {},
      sessionStorageData2: {},
      FilledBy: {},
      userNameRen: "",
      userNameId: "",
      value: ""
    };
  },

  created() {
    this.userNameRen = JSON.parse(sessionStorage.getItem("org")).orgName;
    console.log(this.userNameRen);
    this.userNameId = JSON.parse(sessionStorage.getItem("org")).orgId;
    console.log(this.userNameId);
    this.list();
    this.getInputVal();
    const FilledBy = {
      roleName: JSON.parse(sessionStorage.getItem("account")).realName,
      creatorId: JSON.parse(sessionStorage.getItem("account")).id,
      reportUnitId: JSON.parse(sessionStorage.getItem("org")).orgCode,
      // reportUnit: JSON.parse(sessionStorage.getItem("org")).orgName,
      // reportUnit: JSON.parse(sessionStorage.getItem("org")).departmentName,
      reportUnit: JSON.parse(sessionStorage.getItem("org")).ssbmName,
      // createTime: new Date().toLocaleString(),
      createTime: showTime(new Date()),
      approvalUserId: JSON.parse(sessionStorage.getItem("account")).id,
      approvalUser: JSON.parse(sessionStorage.getItem("account")).realName,
      // pprovalDeptId: JSON.parse(sessionStorage.getItem("org")).orgCode,
      pprovalDeptId: JSON.parse(sessionStorage.getItem("org")).orgId,
      approvalDept: JSON.parse(sessionStorage.getItem("org")).orgName,
      approvalTime: showTime(new Date()),
      // baosongUnit: JSON.parse(sessionStorage.getItem("org")).unitName,
      baosongUnit: JSON.parse(sessionStorage.getItem("org")).orgName,
      departmentName: JSON.parse(sessionStorage.getItem("org")).departmentName
    };
    this.FilledBy = FilledBy;
    console.log(this.FilledBy);

  },
  mounted() {
    this.getUnitTree();
  },
  computed: {
    // 设备部
    getShudianTableLength() { // 输电
      let num = 0;
      this.tableList.tableData.forEach(item => {
        console.log(item);
        if (item.lineCode) {
          num++;
        }
      });
      return num;
    },
    getBiandianTableLength() { // 变电
      let num = 0;
      this.tableDataList.tableData.forEach(item => {
        console.log(item);
        if (item.lineCode) {
          num++;
        }
      });
      return num;
    },
    // 配电部
    getPeidianTableLength() {
      let num = 0;
      this.tableDistributionList.tableData.forEach(item => {
        console.log(item);
        if (item.lineCode) {
          num++;
        }
      });
      return num;
    },
    // 台区
    getTaiquTableLength() {
      let num = 0;
      this.tableMarketingList.tableData.forEach(item => {
        // console.log(item);
        if (item.lineCode) {
          num++;
        }
      });

      return num;
    },
    // 重要用户
    getZyyhTableLength() {
      let num = 0;
      this.tableMarketingDataList.tableData.forEach(item => {
        // console.log(item);
        if (item.lineCode) {
          num++;
        }
      });

      return num;
    }
  },
  methods: {
    async aaaClick(val, row) {
      const res = await getCircuitDetailData({ lineCode: val });
      console.log(res);
      if (res) {
        row.voltageClasses = res.voltageClasses;
        row.unitName = res.unitName;
        row.unitId = res.unitId;
      }

    },
    async bbbClick(val, row) {
      const res = await getCircuitDetailData({ lineCode: val });
      console.log(res);
      if (res) {
        row.voltageClasses = res.voltageClasses;
        row.unitName = res.unitName;
        row.unitId = res.unitId;
      }
    },
    // 配电下拉
    async PdClick(val, row) {
      console.log(val);
      console.log(row);
      const res = await getCircuitDetailData({ lineCode: val });
      console.log(res);
      row.voltageClasses = res.voltageClasses;
      row.unitName = res.unitName;
      row.unitId = res.unitId;
    },
    // 台区下拉
    async TqClick(val, row) {
      console.log(val);
      console.log(row);
      const res = await getCircuitDetailData({ lineCode: val });
      console.log(res);
      row.location = res.location;
      row.unitName = res.unitName;
      row.unitId = res.unitId;
    },
    // 重要客户 下拉
    async ZykhClick(val, row) {
      console.log(val);
      console.log(row);
      const res = await getCircuitDetailData({ lineCode: val });
      console.log(res);
      row.location = res.location;
      row.unitName = res.unitName;
      row.unitId = res.unitId;
      row.grade = res.grade;
    },
    // 重置
    reset() {
      this.form = this.$options.data().form;
      this.pageNum = 1;
      this.$refs.gjxm.paginationAtrrsInner["current-page"] = 1;
      this.list();
    },
    // 查询
    async query() {
      var timeAndSecond1 = "";
      if (this.form.issueTime === undefined || this.form.issueTime === "") {
        this.form.issueTime = "";
      } else {
        timeAndSecond1 = this.form.issueTime[1].slice(0, 10) + " " + "23:59:59";
      }
      this.table.tableData = [];
      const parmas = {
        pageNum: this.pageNum,
        pageSize: 10,
        reportUnitId: this.form.unitId1, // 报送单位
        // creatorDeptId: this.form.taskName, // 报送部门   this.userNameId    undefined
        // creatorDeptId: this.form.taskName == undefined ? this.userNameId : String(this.form.taskName), // 报送部门   this.userNameId    undefined
        eventLvCode: this.form.eventLvCode, // 事件级别
        eventCode: this.form.eventCode, // 事件类别
        // occurrenceTime: this.form.occurrenceTime, // 发生时间
        // issueTime: this.form.issueTime, // 下发时间
        occurrenceStartTime: this.form.occurrenceTime ? this.form.occurrenceTime[0] : "", // 发生开始时间
        occurrenceEndTime: this.form.occurrenceTime ? this.form.occurrenceTime[1] : "", // 发生结束时间
        emergencyEvent: this.form.emergencyEvent, // 应急事件
        createStartTime: this.form.issueTime ? this.form.issueTime[0] : "", // 报送开始时间
        // createStartTime: this.form.issueTime ? timeAndSecond : "", // 下发开始时间
        // createEndTime: this.form.issueTime ? this.form.issueTime[1] : "" // 下发结束时间
        createEndTime: this.form.issueTime ? timeAndSecond1 : "" // 报送结束时间
      };
      const res = await zqxxbsListData(parmas);
      this.table.tableData = res.data; // 设备部
      this.paginationAtrrs.total = res.total;
    },
    deptChoose(val, item) {
      this.$set(this.form, "unitId1", val[0].id);
      this.$set(this.form, "unitName1", val[0].orgName);
    },
    handleBtn(item) {
      this[item.id]();
    },
    handleBtn0(item) {
      this[item.id]();
    },
    handleBtn1(item) {
      this[item.id]();
    },
    handleBtnOf(item) {
      this[item.id]();
    },
    resetForm() {
      this.tableConfig.formData = this.$options.data().tableConfig.formData;
      this.list();
    },
    getUnitTree() {
      // getHomePageEventTree().then(res => {
      getSubclassUntilList({ orgId: JSON.parse(sessionStorage.getItem("org")).orgId }).then(res => {
        this.formData[4].treeData.attrs.data = res;
        // console.log(res);
        // console.log(this.formData[4].treeData.attrs.data);
        // this.$set(this.form, "unitId1", res[0].id);
        // this.$set(this.form, "unitName1", res[0].orgName);
      });
    },
    // 获取下拉框数据
    getInputVal() {
      this.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroupEmergency({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.options = option;
          });
        }
      });
      this.formConfig.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroupEmergency({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.option = option;
          });
        }
      });
      this.formConfig1.formData.forEach((item) => {
        if (item.dic) {
          getDictByGroupEmergency({ groupCode: item.dic }).then(res => {
            const option = res.map((item) => {
              return {
                label: item.dicName,
                value: Number(item.dicCode)
              };
            });
            item.option = option;
          });
        }
      });
    },
    // 列表
    list() {
      const parmas = {
        pageNum: this.pageNum,
        pageSize: 10
      };
      zqxxbsListData(parmas).then(res => {
        this.table.tableData = res.data;
        this.paginationAtrrs.total = res.total;
      });
      // 设备部
      // if (this.FilledBy.pprovalDeptId === "1533835007333440" || this.FilledBy.pprovalDeptId === "1533835007333666" || this.FilledBy.pprovalDeptId === "1533835007333451" || JSON.parse(sessionStorage.getItem("account")).id === "1530637030785057") {
      //   this.table.tableData = res.data; // 设备部
      //   // } else if (this.userNameRen === "配电部") {
      // } else if (this.FilledBy.pprovalDeptId === "1533835007333568") {

      //   this.distributionData.tableData = res.data; // 配电部
      // } else if (this.FilledBy.pprovalDeptId === "1533835007333504" || this.FilledBy.pprovalDeptId === "1533835117333666") {
      //   this.marketingData.tableData = res.data; // 营销
      // }

    },
    onActionClick(item, index) {
      this[item.id](); // 调用按钮对应方法
    },
    distributionDataClick(item) {
      this[item.id]();
    },
    marketingDataDataClick(item) {
      this[item.id]();
    },
    // 获取 线路数据
    async getInformationLoadDataSdxl() {
      getCircuitData({ specialtyCode: "sdxl" }).then(res => {
        const option = res.map((item) => {
          return {
            label: item.lineName,
            value: item.lineCode
          };
        });
        this.SbxlOption = option;
      });
    },
    // 变电站
    async getInformationLoadDataBdz() {
      const parmas = {
        specialtyCode: "bdz"
      };
      const res = await getCircuitData(parmas);
      console.log(res);
      const option = res.map((item) => {
        return {
          label: item.lineName,
          value: item.lineCode
        };
      });
      this.BdzlOption = option;
    },
    // 配电线路
    async getInformationLoadDataPdxl() {
      const parmas = {
        specialtyCode: "pdxl"
      };
      const res = await getCircuitData(parmas);
      console.log(res);
      const option = res.map((item) => {
        return {
          label: item.lineName,
          value: item.lineCode
        };
      });
      this.PdlOption = option;
    },
    // 台区
    async getInformationLoadDataTq() {
      const parmas = {
        specialtyCode: "tq"
      };
      const res = await getCircuitData(parmas);
      console.log(res);
      const option = res.map((item) => {
        return {
          label: item.lineName,
          value: item.lineCode
        };
      });
      this.TqOption = option;
    },
    // 重要用户
    async getInformationLoadDataZyyh() {
      const parmas = {
        specialtyCode: "zyyh"
      };
      const res = await getCircuitData(parmas);
      console.log(res);
      const option = res.map((item) => {
        return {
          label: item.lineName,
          value: item.lineCode
        };
      });
      this.ZykhOption = option;
    },
    // 普通用户
    async getInformationLoadDataPtyh() {
      const parmas = {
        specialtyCode: "ptyh"
      };
      const res = await getCircuitData(parmas);
      console.log(res);
      const option = res.map((item) => {
        return {
          label: item.lineName,
          value: item.lineCode
        };
      });
      this.PtyhOption = option;
    },
    //   - 填报
    writeReport(val) {
      console.log(val, "填报数据");
      // const reName = JSON.parse(sessionStorage.getItem("account")).realName;
      // if (val.orgType == "2" && reName.indexOf("设备") != -1 && val.creatorDeptName.indexOf("设备") != -1 || reName.indexOf("配电") != -1 && val.creatorDeptName.indexOf("配电") != -1 || reName.indexOf("营销") != -1 && val.creatorDeptName.indexOf("营销") != -1) { // orgType 1 单位   2 部门
      if (val.category == "1") { // orgType 1 单位   2 部门
        this.dialogConfig.isShow = true;
        console.log(val);
        this.reportId = val.reportId;
        this.xinzengNum = val.writeState;
        // console.log(this.xinzengNum)
        this.editId = val.id;
        this.getInformationLoadDataSdxl();
        this.getInformationLoadDataBdz();
        this.$nextTick(() => {
          console.log(this.FilledBy, "111111111111111");
          this.$refs.formConfigData.form = {
            ...this.FilledBy
          };
          console.log(this.$refs.formConfigData.form, "222222222222222");
        });
        // } else if (val.orgType == "2" && reName.indexOf("设备") != -1 && val.creatorDeptName.indexOf("设备") != -1 || reName.indexOf("配电") != -1 && val.creatorDeptName.indexOf("配电") != -1 || reName.indexOf("营销") != -1 && val.creatorDeptName.indexOf("营销") != -1) {
      } else if (val.category == "3") {
        this.distributionDialogConfig.isShow = true;
        this.xinzengNum = val.writeState;
        // console.log(this.xinzengNum)
        console.log(val.id);
        this.editId = val.id;
        this.reportId = val.reportId;
        this.getInformationLoadDataPdxl();

        this.$nextTick(() => {
          console.log(this.FilledBy, "111111111111111");
          this.$refs.formConfigData1.form = {
            ...this.FilledBy
          };
          console.log(this.$refs.formConfigData1.form, "222222222222222");
        });
        // } else if (val.orgType == "2" && reName.indexOf("设备") != -1 && val.creatorDeptName.indexOf("设备") != -1 || reName.indexOf("配电") != -1 && val.creatorDeptName.indexOf("配电") != -1 || reName.indexOf("营销") != -1 && val.creatorDeptName.indexOf("营销") != -1) {
      } else if (val.category == "2") {
        this.dialogMarketingConfig.isShow = true;
        this.xinzengNum = val.writeState;
        console.log(this.xinzengNum);
        console.log(val.id);
        this.editId = val.id;
        this.reportId = val.reportId;
        this.getInformationLoadDataTq();
        this.getInformationLoadDataZyyh();
        this.getInformationLoadDataPtyh();
        this.$nextTick(() => {
          console.log(this.FilledBy, "111111111111111");
          this.$refs.formConfigData2.form = {
            ...this.FilledBy
          };
          console.log(this.$refs.formConfigData2.form, "222222222222222");
        });
        // } else if (val.orgType == "1") {
      } else {
        console.log("9090909");
        this.dialogSetOf.isShow = true;
        this.reportId = val.reportId;
        this.xinzengNum = val.writeState;
        // console.log(this.xinzengNum)
        this.editId = val.id;
        // 设备
        this.getInformationLoadDataSdxl();
        this.getInformationLoadDataBdz();
        // 配电线路
        this.getInformationLoadDataPdxl();
        // 营销
        this.getInformationLoadDataTq();
        this.getInformationLoadDataZyyh();
        this.getInformationLoadDataPtyh();
        this.$nextTick(() => {
          // console.log(this.FilledBy, "111111111111111");
          this.$refs.formConfigData.form = {
            ...this.FilledBy
          };
          // console.log(this.$refs.formConfigData.form, "222222222222222");
        });
      }

    },
    // 设备 -续保
    writeResubmit(val) {
      // const reName = JSON.parse(sessionStorage.getItem("account")).realName;
      // if (val.orgType == "2" && reName.indexOf("设备") != -1 && val.creatorDeptName.indexOf("设备") != -1 || reName.indexOf("配电") != -1 && val.creatorDeptName.indexOf("配电") != -1 || reName.indexOf("营销") != -1 && val.creatorDeptName.indexOf("营销") != -1) {
      if (val.category == "1") {
        this.$nextTick(() => {
          this.dialogConfig.isShow = true;
          this.$refs.formConfigData.form = this.FilledBy;
        });
        this.reportId = val.reportId;
        this.xinzengNum = val.writeState;
        // console.log(this.xinzengNum)
        this.editId = val.id;
        // console.log(this.xinzengNum)
        // this.xinzengNum = 0
        this.getInformationLoadDataSdxl();
        this.getInformationLoadDataBdz();
        getResubmitDetailData({ id: val.id, specialtyCode: "sdxl" }).then(res => {
          // console.log(res, "测试");
          this.$refs.formConfigData.form = res;
          // console.log(this.$refs.formConfigData.form, "]]]]]]]]]]]]]]]")
          this.$set(this.$refs.formConfigData.form, "baosongUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData.form, "reportUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData.form, "reportUnitId", res.reportUnitId); // 报送单位名称id
          this.$set(this.$refs.formConfigData.form, "reportUnit", res.creatorDeptName); // 创建人部门名称
          this.$set(this.$refs.formConfigData.form, "orgCode", res.creatorDeptId);// 	创建人部门id
          this.$set(this.$refs.formConfigData.form, "roleName", res.creator);// 	创建人
          this.$set(this.$refs.formConfigData.form, "roleCode", res.createId);// 	创建人id
          this.$set(this.$refs.formConfigData.form, "createTime", res.createTime);// 	创建时间
          if (res.sdInfoDetailVoList.length <= 0 || res.sdInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableList.tableData = res.sdInfoDetailVoList;
          }
          if (res.bdInfoDetailVoList.length <= 0 || res.bdInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableDataList.tableData = res.bdInfoDetailVoList;
          }
          // this.tableList.tableData = res.sdInfoDetailVoList;
          // this.tableDataList.tableData = res.bdInfoDetailVoList;
          // this.$refs.formComponentData.form = res
          // this.$refs.formInfoData.form = res
          // this.tableList.tableData = res.reportTaskListVos
        });
        // } else if (val.orgType == "2" && reName.indexOf("设备") != -1 && val.creatorDeptName.indexOf("设备") != -1 || reName.indexOf("配电") != -1 && val.creatorDeptName.indexOf("配电") != -1 || reName.indexOf("营销") != -1 && val.creatorDeptName.indexOf("营销") != -1) {
      } else if (val.category == "3") {
        this.distributionDialogConfig.isShow = true;
        this.xinzengNum = val.writeState;
        this.editId = val.id;
        this.reportId = val.reportId;
        this.getInformationLoadDataPdxl();
        // console.log(this.xinzengNum)
        getResubmitDetailData({ id: val.id, specialtyCode: "pdxl" }).then(res => {
          this.$refs.formConfigData1.form = res;
          // console.log(this.$refs.formConfigData1.form, "shuju")
          this.$set(this.$refs.formConfigData1.form, "baosongUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData1.form, "reportUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData1.form, "reportUnitId", res.reportUnitId); // 报送单位名称id
          this.$set(this.$refs.formConfigData1.form, "reportUnit", res.creatorDeptName); // 创建人部门名称
          this.$set(this.$refs.formConfigData1.form, "orgCode", res.creatorDeptId);// 	创建人部门id
          this.$set(this.$refs.formConfigData1.form, "roleName", res.creator);// 	创建人
          this.$set(this.$refs.formConfigData1.form, "roleCode", res.createId);// 	创建人id
          this.$set(this.$refs.formConfigData1.form, "createTime", res.createTime);// 	创建时间
          if (res.pdInfoDetailVoList.length <= 0 || res.pdInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableDistributionList.tableData = res.pdInfoDetailVoList;
          }
          // this.tableDistributionList.tableData = res.pdInfoDetailVoList;
        });
        console.log(this.$refs.formConfigData1.form, "this.$refs.formConfigData1.form");
        // } else if (val.orgType == "2" && reName.indexOf("设备") != -1 && val.creatorDeptName.indexOf("设备") != -1 || reName.indexOf("配电") != -1 && val.creatorDeptName.indexOf("配电") != -1 || reName.indexOf("营销") != -1 && val.creatorDeptName.indexOf("营销") != -1) {
      } else if (val.category == "2") {
        this.dialogMarketingConfig.isShow = true;
        this.$nextTick(() => {
          this.$refs.formConfigData2.form = this.FilledBy;
          console.log(this.$refs.formConfigData2.form);
        });
        this.xinzengNum = val.writeState;
        console.log(this.xinzengNum);
        console.log(val.id);
        this.editId = val.id;
        this.reportId = val.reportId;
        this.getInformationLoadDataTq();
        this.getInformationLoadDataZyyh();
        this.getInformationLoadDataPtyh();
        getResubmitDetailData({ id: val.id, specialtyCode: "tq" }).then(res => {
          this.$refs.formConfigData2.form = res;
          this.$set(this.$refs.formConfigData2.form, "baosongUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData2.form, "reportUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData2.form, "reportUnitId", res.reportUnitId); // 报送单位名称id
          this.$set(this.$refs.formConfigData2.form, "reportUnit", res.creatorDeptName); // 创建人部门名称
          this.$set(this.$refs.formConfigData2.form, "orgCode", res.creatorDeptId);// 	创建人部门id
          this.$set(this.$refs.formConfigData2.form, "roleName", res.creator);// 	创建人
          this.$set(this.$refs.formConfigData2.form, "roleCode", res.createId);// 	创建人id
          this.$set(this.$refs.formConfigData2.form, "createTime", res.createTime);// 	创建时间
          if (res.tqInfoDetailVoList.length <= 0 || res.tqInfoDetailVoList == []) {
            console.log("小了");
          } else if (val.orgType == "1") {
            // console.log("触发了");
            this.tableMarketingList.tableData = res.tqInfoDetailVoList; //  台账
          }
          if (res.zyyhInfoDetailVoList.length <= 0 || res.zyyhInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableMarketingDataList.tableData = res.zyyhInfoDetailVoList; // 重要客户
          }
          if (res.ptyhInfoDetailDetailVo.length <= 0 || res.ptyhInfoDetailDetailVo == [] || res.ptyhInfoDetailDetailVo == {}) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableMarketingPutong.tableData = Array(res.ptyhInfoDetailDetailVo); // 普通客户
          }
          // this.tableMarketingList.tableData = res.tqInfoDetailVoList; //  台账
          // this.tableMarketingDataList.tableData = res.zyyhInfoDetailVoList; // 重要客户
          // this.tableMarketingPutong.tableData = Array(res.ptyhInfoDetailDetailVo); // 普通客户
        });
        // } else if (val.orgType == "1") {
      } else {

        this.$nextTick(() => {
          console.log(this.FilledBy, "111111111111111");
          this.$refs.formConfigData.form = {
            ...this.FilledBy
          };
          console.log(this.$refs.formConfigData.form, "222222222222222");
        });
        this.reportId = val.reportId;
        this.xinzengNum = val.writeState;
        // console.log(this.xinzengNum)
        this.editId = val.id;
        // console.log(this.xinzengNum)
        // this.xinzengNum = 0
        // 设备
        this.getInformationLoadDataSdxl();
        this.getInformationLoadDataBdz();
        // 配电线路
        this.getInformationLoadDataPdxl();
        // 营销
        this.getInformationLoadDataTq();
        this.getInformationLoadDataZyyh();
        this.getInformationLoadDataPtyh();
        getResubmitDetailData({ id: val.id, specialtyCode: "" }).then(res => {
          // console.log(res, "测试");
          this.$refs.formConfigData.form = res;
          // console.log(this.$refs.formConfigData.form, "]]]]]]]]]]]]]]]")
          this.$set(this.$refs.formConfigData.form, "baosongUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData.form, "reportUnit", res.reportUnit); // 报送单位名称
          this.$set(this.$refs.formConfigData.form, "reportUnitId", res.reportUnitId); // 报送单位名称id
          this.$set(this.$refs.formConfigData.form, "reportUnit", res.creatorDeptName); // 创建人部门名称
          this.$set(this.$refs.formConfigData.form, "orgCode", res.creatorDeptId);// 	创建人部门id
          this.$set(this.$refs.formConfigData.form, "roleName", res.creator);// 	创建人
          this.$set(this.$refs.formConfigData.form, "roleCode", res.createId);// 	创建人id
          this.$set(this.$refs.formConfigData.form, "createTime", res.createTime);// 	创建时间
          if (res.sdInfoDetailVoList.length <= 0 || res.sdInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableList.tableData = res.sdInfoDetailVoList;
          }
          if (res.bdInfoDetailVoList.length <= 0 || res.bdInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableDataList.tableData = res.bdInfoDetailVoList;
          }
          // 配电
          if (res.pdInfoDetailVoList.length <= 0 || res.pdInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableDistributionList.tableData = res.pdInfoDetailVoList;
          }
          // 营销
          if (res.tqInfoDetailVoList.length <= 0 || res.tqInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableMarketingList.tableData = res.tqInfoDetailVoList; //  台账
          }
          if (res.zyyhInfoDetailVoList.length <= 0 || res.zyyhInfoDetailVoList == []) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableMarketingDataList.tableData = res.zyyhInfoDetailVoList; // 重要客户
          }
          if (res.ptyhInfoDetailDetailVo.length <= 0 || res.ptyhInfoDetailDetailVo == [] || res.ptyhInfoDetailDetailVo == {}) {
            console.log("小了");
          } else {
            // console.log("触发了");
            this.tableMarketingPutong.tableData = Array(res.ptyhInfoDetailDetailVo); // 普通客户
          }
          // this.tableList.tableData = res.sdInfoDetailVoList;
          // this.tableDataList.tableData = res.bdInfoDetailVoList;
          // this.$refs.formComponentData.form = res
          // this.$refs.formInfoData.form = res
          // this.tableList.tableData = res.reportTaskListVos
        });
        this.dialogSetOf.isShow = true;
      }


    },
    // 配电部 填报
    distributionDataListClick(val) {
      this.distributionDialogConfig.isShow = true;
      this.xinzengNum = val.writeState;
      // console.log(this.xinzengNum)
      console.log(val.id);
      this.editId = val.id;
      this.reportId = val.reportId;
      this.getInformationLoadDataPdxl();

      this.$nextTick(() => {
        console.log(this.FilledBy, "111111111111111");
        this.$refs.formConfigData1.form = {
          ...this.FilledBy
        };
        console.log(this.$refs.formConfigData1.form, "222222222222222");
      });
    },
    // 配电 - 续保
    PdDataListClick(val) {
      this.distributionDialogConfig.isShow = true;
      this.xinzengNum = val.writeState;
      this.editId = val.id;
      this.reportId = val.reportId;
      this.getInformationLoadDataPdxl();
      // console.log(this.xinzengNum)
      getResubmitDetailData({ id: val.id, specialtyCode: "pdxl" }).then(res => {
        this.$refs.formConfigData1.form = res;
        // console.log(this.$refs.formConfigData1.form, "shuju")
        this.$set(this.$refs.formConfigData1.form, "baosongUnit", res.reportUnit); // 报送单位名称
        this.$set(this.$refs.formConfigData1.form, "reportUnit", res.reportUnit); // 报送单位名称
        this.$set(this.$refs.formConfigData1.form, "reportUnitId", res.reportUnitId); // 报送单位名称id
        this.$set(this.$refs.formConfigData1.form, "reportUnit", res.creatorDeptName); // 创建人部门名称
        this.$set(this.$refs.formConfigData1.form, "orgCode", res.creatorDeptId);// 	创建人部门id
        this.$set(this.$refs.formConfigData1.form, "roleName", res.creator);// 	创建人
        this.$set(this.$refs.formConfigData1.form, "roleCode", res.createId);// 	创建人id
        this.$set(this.$refs.formConfigData1.form, "createTime", res.createTime);// 	创建时间
        if (res.pdInfoDetailVoList.length <= 0 || res.pdInfoDetailVoList == []) {
          console.log("小了");
        } else {
          // console.log("触发了");
          this.tableDistributionList.tableData = res.pdInfoDetailVoList;
        }
        // this.tableDistributionList.tableData = res.pdInfoDetailVoList;
      });
      console.log(this.$refs.formConfigData1.form, "this.$refs.formConfigData1.form");
    },
    // 营销部 填报
    marketingClick(val) {
      this.dialogMarketingConfig.isShow = true;
      this.xinzengNum = val.writeState;
      console.log(this.xinzengNum);
      console.log(val.id);
      this.editId = val.id;
      this.reportId = val.reportId;
      this.getInformationLoadDataTq();
      this.getInformationLoadDataZyyh();
      this.getInformationLoadDataPtyh();
      this.$nextTick(() => {
        console.log(this.FilledBy, "111111111111111");
        this.$refs.formConfigData2.form = {
          ...this.FilledBy
        };
        console.log(this.$refs.formConfigData2.form, "222222222222222");
      });

    },
    // 营销部 续报
    marketingXubaoClick(val) {
      this.dialogMarketingConfig.isShow = true;
      this.$nextTick(() => {
        this.$refs.formConfigData2.form = this.FilledBy;
        console.log(this.$refs.formConfigData2.form);
      });
      this.xinzengNum = val.writeState;
      console.log(this.xinzengNum);
      console.log(val.id);
      this.editId = val.id;
      this.reportId = val.reportId;
      this.getInformationLoadDataTq();
      this.getInformationLoadDataZyyh();
      this.getInformationLoadDataPtyh();
      getResubmitDetailData({ id: val.id, specialtyCode: "tq" }).then(res => {
        this.$refs.formConfigData2.form = res;
        this.$set(this.$refs.formConfigData2.form, "baosongUnit", res.reportUnit); // 报送单位名称
        this.$set(this.$refs.formConfigData2.form, "reportUnit", res.reportUnit); // 报送单位名称
        this.$set(this.$refs.formConfigData2.form, "reportUnitId", res.reportUnitId); // 报送单位名称id
        this.$set(this.$refs.formConfigData2.form, "reportUnit", res.creatorDeptName); // 创建人部门名称
        this.$set(this.$refs.formConfigData2.form, "orgCode", res.creatorDeptId);// 	创建人部门id
        this.$set(this.$refs.formConfigData2.form, "roleName", res.creator);// 	创建人
        this.$set(this.$refs.formConfigData2.form, "roleCode", res.createId);// 	创建人id
        this.$set(this.$refs.formConfigData2.form, "createTime", res.createTime);// 	创建时间
        if (res.tqInfoDetailVoList.length <= 0 || res.tqInfoDetailVoList == []) {
          console.log("小了");
        } else {
          // console.log("触发了");
          this.tableMarketingList.tableData = res.tqInfoDetailVoList; //  台账
        }
        if (res.zyyhInfoDetailVoList.length <= 0 || res.zyyhInfoDetailVoList == []) {
          console.log("小了");
        } else {
          // console.log("触发了");
          this.tableMarketingDataList.tableData = res.zyyhInfoDetailVoList; // 重要客户
        }
        if (res.ptyhInfoDetailDetailVo.length <= 0 || res.ptyhInfoDetailDetailVo == [] || res.ptyhInfoDetailDetailVo == {}) {
          console.log("小了");
        } else {
          // console.log("触发了");
          this.tableMarketingPutong.tableData = Array(res.ptyhInfoDetailDetailVo); // 普通客户
        }
        // this.tableMarketingList.tableData = res.tqInfoDetailVoList; //  台账
        // this.tableMarketingDataList.tableData = res.zyyhInfoDetailVoList; // 重要客户
        // this.tableMarketingPutong.tableData = Array(res.ptyhInfoDetailDetailVo); // 普通客户
      });
    },
    // 应急事件 下拉监听
    handleChange(val) {
      console.log(val);
      getYjsjGetById({ id: val }).then(res => {
        console.log(res);
        this.$refs.formConfigData.form = res;
        this.$refs.formConfigData1.form = res;
        this.$refs.formConfigData2.form = res;
        // this.$refs.formInfoData.form = res
      });
    },
    // 多选单选
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    selectChange(e, i) {
      // if (i.label === "部门") {
      //   this.tableSelectNum = e[0]
      // }
    },
    // 分页
    handleCurrentChange(val) {
      this.pageNum = val;
      this.list();
    },
    // 应急事件
    handleEmergencyEvents(val) {
      console.log(val);
      this.$router.push({
        path: "/EmergencyDetail",
        query: { id: val.emergencyId }
      });
    },
    // 设备 - 提交
    async BSubmitSb() {
      let timeOne = true;
      this.tableList.tableData.forEach((item, index) => {
        console.log(item);
        console.log(typeof item.recoverTime);
        if (item.recoverTime === "" || item.recoverTime === null) {
          console.log("vcvcvcv");
          timeOne = true;
        } else if (item.recoverTime < item.blackoutTime) {
          console.log("vcvcvcv12111");
          this.$message({
            message: `输电线路第${index + 1}条复电时间不能小于停电时间`,
            type: "error"
          });
          timeOne = false;
        }
      });
      let timeTwo = true;
      this.tableDataList.tableData.forEach((item, index1) => {
        if (item.recoverTime === "" || item.recoverTime === null) {
          timeTwo = true;
        } else if (item.recoverTime < item.blackoutTime) {
          this.$message({
            message: `变电站第${index1 + 1}条复电时间不能小于停电时间`,
            type: "error"
          });
          timeTwo = false;
        }

      });
      // 新增提交
      const parmas = {
        id: this.editId,
        reportId: this.reportId,
        sdInfoDetailSaveDtos: this.tableList.tableData, // 输电
        bdInfoDetailSaveDtos: this.tableDataList.tableData, // 变电
        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        // creatorDeptName: this.sessionStorageData.realName, // 创建人部门名称
        // creatorDeptId: this.sessionStorageData.createId,
        reportUnit: this.$refs.formConfigData.form.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        // creator: this.sessionStorageData2.roleName, // 创建人
        // creatorId: this.sessionStorageData2.roleCode
        creator: this.$refs.formConfigData.form.roleName, // 创建人
        creatorId: this.$refs.formConfigData.form.creatorId


      };
      // 续报提交
      const parmas1 = {
        id: this.editId,
        reportId: this.reportId,
        sdInfoDetailUdpDtos: this.tableList.tableData, // 输电
        bdInfoDetailUdpDtos: this.tableDataList.tableData, // 变电
        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        reportUnit: this.$refs.formConfigData.form.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        modifier: this.$refs.formConfigData.form.roleName, // 创建人
        modifyId: this.$refs.formConfigData.form.roleCode
      };
      if (timeOne && timeTwo) {
        console.log("触发");
        const res = await this.xinzengNum === "0" ? zqxxbsSubmit(parmas) : SaveUpdById(parmas1);
        console.log(res);
        if (res) {
          this.$nextTick(() => {
            this.list();
            this.dialogConfig.isShow = false;
            this.$message({
              message: "提交成功",
              type: "success"
            });
          });
          // this.$router.go(0);
          // setTimeout(() => {
          // }, 0);
        }
      }

    },

    // 配电 - 提交
    async BSubmitPd() {
      // console.log(this.$refs.formConfigData1.form);
      let timeOne = true;
      this.tableDistributionList.tableData.forEach((item, index) => {
        console.log(item);
        if (item.recoverTime === "" || item.recoverTime === null) {
          timeOne = true;
        } else if (item.recoverTime < item.blackoutTime) {
          this.$message({
            message: `停运配电线路第${index + 1}条复电时间不能小于停电时间`,
            type: "error"
          });
          timeOne = false;
        }
      });

      const parmas = {
        id: this.editId,
        reportId: this.reportId,
        pdInfoDetailSaveDtos: this.tableDistributionList.tableData, // 配电
        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        // creatorDeptName: this.sessionStorageData.realName, // 创建人部门名称
        // creatorDeptId: this.sessionStorageData.createId,
        reportUnit: this.FilledBy.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        // creator: this.sessionStorageData2.roleName, // 创建人
        // creatorId: this.sessionStorageData2.roleCode
        creator: this.FilledBy.roleName, // 创建人
        creatorId: this.FilledBy.creatorId
      };
      const parmas1 = {
        id: this.editId,
        reportId: this.reportId,
        pdInfoDetailUdpDtos: this.tableDistributionList.tableData,
        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        reportUnit: this.$refs.formConfigData1.form.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        modifier: this.$refs.formConfigData1.form.roleName, // 创建人
        modifyId: this.$refs.formConfigData1.form.roleCode
      };
      if (timeOne) {
        const res = await this.xinzengNum === "0" ? zqxxbsSubmit(parmas) : SaveUpdById(parmas1);
        // console.log(res)
        if (res) {
          this.$message({
            message: "提交成功",
            type: "success"
          });
          this.distributionDialogConfig.isShow = false;
          this.list();
          // this.$router.go(0);
          // setTimeout(() => {
          // }, 0);

        }
      }
    },
    // 营销
    async BSubmitYx() {
      let timeOne = true;
      this.tableMarketingList.tableData.forEach((item, index) => {
        console.log(item);
        if (item.recoverTime === "" || item.recoverTime === null) {
          timeOne = true;
        } else if (item.recoverTime < item.blackoutTime) {
          this.$message({
            message: `停运台区第${index + 1}条复电时间不能小于停电时间`,
            type: "error"
          });
          timeOne = false;
        }
      });
      let timeTwo = true;
      this.tableMarketingDataList.tableData.forEach((item, index) => {
        console.log(item);
        if (item.recoverTime === "" || item.recoverTime === null) {
          timeTwo = true;
        } else if (item.recoverTime < item.blackoutTime) {
          this.$message({
            message: `停电重要用户第${index + 1}条复电时间不能小于停电时间`,
            type: "error"
          });
          timeTwo = false;
        }
      });
      // console.log(this.$refs.formConfigData2.form, "this.$refs.formConfigData2.form")
      const arr_obj = this.tableMarketingPutong.tableData;
      console.log(arr_obj);
      // const obj_obj = {
      //   recoverCount: this.tableMarketingPutong.tableData.recoverCount,
      //   blackoutCount: this.tableMarketingPutong.tableData.blackoutCount
      // }
      // console.log(obj_obj)
      let obj_obj = {};
      arr_obj.map(item => {
        console.log(item);
        if (item.blackoutCount === "") {
          item.blackoutCount = 0;
        }
        if (item.recoverCount === "") {
          item.recoverCount = 0;
        }
        obj_obj = item;
      });
      const parmas = {
        id: this.editId,
        reportId: this.reportId,
        tqInfoDetailSaveDtos: this.tableMarketingList.tableData, // 台区
        zyyhInfoDetailSaveDtos: this.tableMarketingDataList.tableData, // 重要客户
        ptyhInfoDetailSaveDto: obj_obj, // 普通用户
        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        reportUnit: this.FilledBy.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        // creatorDeptName: this.sessionStorageData.realName, // 创建人部门名称
        // creatorDeptId: this.sessionStorageData.createId,
        // creator: this.sessionStorageData2.roleName, // 创建人
        // creatorId: this.sessionStorageData2.roleCode
        creator: this.FilledBy.roleName, // 创建人
        creatorId: this.FilledBy.creatorId
      };
      const parmas1 = {
        id: this.editId,
        reportId: this.reportId,
        tqInfoDetailUdpDtos: this.tableMarketingList.tableData, // 台区
        zyyhInfoDetailUdpDtos: this.tableMarketingDataList.tableData, // 重要客户
        ptyhInfoDetailUdpDto: obj_obj, // 普通用户
        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        reportUnit: this.$refs.formConfigData2.form.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        modifier: this.$refs.formConfigData2.form.roleName, // 创建人
        modifyId: this.$refs.formConfigData2.form.roleCode
      };
      console.log(parmas);
      // const res = await zqxxbsSubmit(parmas)
      if (timeOne && timeTwo) {
        const res = await this.xinzengNum === "0" ? zqxxbsSubmit(parmas) : SaveUpdById(parmas1);
        // console.log(res)
        if (res) {
          this.$message({
            message: "提交成功",
            type: "success"
          });

          this.dialogMarketingConfig.isShow = false;
          this.list();
          // this.$router.go(0);
          // setTimeout(() => {
          //   this.$router.go(0);
          // }, 0);
        }
      }


    },
    // 全部- 集合 - 提交
    async BSubmitOf() {
      let timeOne = true;
      this.tableList.tableData.forEach((item, index) => {
        console.log(item);
        if (item.recoverTime === "" || item.recoverTime === null) {
          timeOne = true;
        } else if (item.recoverTime < item.blackoutTime) {
          this.$message({
            message: `输电线路第${index + 1}条复电时间不能小于停电时间`,
            type: "error"
          });
          timeOne = false;
        }
      });
      let timeTwo = true;
      this.tableDataList.tableData.forEach((item, index1) => {
        if (item.recoverTime === "" || item.recoverTime === null) {
          timeTwo = true;
        } else if (item.recoverTime < item.blackoutTime) {
          this.$message({
            message: `变电站第${index1 + 1}条复电时间不能小于停电时间`,
            type: "error"
          });
          timeTwo = false;
        }

      });
      const arr_obj = this.tableMarketingPutong.tableData;
      console.log(arr_obj);
      // const obj_obj = {
      //   recoverCount: this.tableMarketingPutong.tableData.recoverCount,
      //   blackoutCount: this.tableMarketingPutong.tableData.blackoutCount
      // }
      // console.log(obj_obj)
      let obj_obj = {};
      arr_obj.map(item => {
        console.log(item);
        if (item.blackoutCount === "") {
          item.blackoutCount = 0;
        }
        if (item.recoverCount === "") {
          item.recoverCount = 0;
        }
        obj_obj = item;
      });
      // 新增提交
      const parmas = {
        id: this.editId,
        reportId: this.reportId,
        // 设备
        sdInfoDetailSaveDtos: this.tableList.tableData, // 输电
        bdInfoDetailSaveDtos: this.tableDataList.tableData, // 变电
        // 配电
        pdInfoDetailSaveDtos: this.tableDistributionList.tableData, // 配电
        // 营销
        tqInfoDetailSaveDtos: this.tableMarketingList.tableData, // 台区
        zyyhInfoDetailSaveDtos: this.tableMarketingDataList.tableData, // 重要客户
        ptyhInfoDetailSaveDto: obj_obj, // 普通用户

        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        // creatorDeptName: this.sessionStorageData.realName, // 创建人部门名称
        // creatorDeptId: this.sessionStorageData.createId,
        reportUnit: this.$refs.formConfigData.form.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        // creator: this.sessionStorageData2.roleName, // 创建人
        // creatorId: this.sessionStorageData2.roleCode
        creator: this.$refs.formConfigData.form.roleName, // 创建人
        creatorId: this.$refs.formConfigData.form.creatorId
      };
      // 续报提交
      const parmas1 = {
        id: this.editId,
        reportId: this.reportId,
        // 设备
        sdInfoDetailUdpDtos: this.tableList.tableData, // 输电
        bdInfoDetailUdpDtos: this.tableDataList.tableData, // 变电
        // 配电
        pdInfoDetailUdpDtos: this.tableDistributionList.tableData,
        // 营销
        tqInfoDetailUdpDtos: this.tableMarketingList.tableData, // 台区
        zyyhInfoDetailUdpDtos: this.tableMarketingDataList.tableData, // 重要客户
        ptyhInfoDetailUdpDto: obj_obj, // 普通用户
        // reportUnit: this.sessionStorageData1.orgName, // 报送单位名称
        // reportUnitId: this.sessionStorageData1.orgCode,
        reportUnit: this.$refs.formConfigData.form.baosongUnit, // 报送单位名称
        reportUnitId: "1",
        modifier: this.$refs.formConfigData.form.roleName, // 创建人
        modifyId: this.$refs.formConfigData.form.roleCode
      };
      if (timeOne && timeTwo) {
        console.log("触发");
        const res = await this.xinzengNum === "0" ? zqxxbsSubmit(parmas) : SaveUpdById(parmas1);
        console.log(res);
        if (res) {
          this.$message({
            message: "提交成功",
            type: "success"
          });
          // this.dialogConfig.isShow = false;
          this.dialogSetOf.isShow = false;
          // dialogSetOf;
          this.list();
          // this.$router.go(0);
          // setTimeout(() => {
          // }, 0);
        }
      }
    },
    // 全部- 集合 - 取消
    getBackOf() {
      // 设备
      this.$nextTick(() => {
        this.tableList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        this.tableDataList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        // 配电
        this.tableDistributionList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        // 营销
        this.tableMarketingList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        this.tableMarketingDataList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        // 普通用户
        this.tableMarketingPutong.tableData = [
          {
            blackoutCount: "",
            recoverCount: ""
            // recoverRatio: ""
          }
        ];
      });
      this.dialogSetOf.isShow = false;
    },
    // 设备
    getBack() {
      this.$nextTick(() => {
        this.tableList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        this.tableDataList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
      });
      this.dialogConfig.isShow = false;
    },
    // 配电
    getBack1() {
      this.$nextTick(() => {
        this.tableList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        this.tableDistributionList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
      });
      this.distributionDialogConfig.isShow = false;
    },
    // 营销
    getBack2() {
      this.$nextTick(() => {
        this.tableList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
        this.tableMarketingDataList.tableData = [{
          lineName: "",
          lineCode: "",
          blackoutTime: "",
          recoverTime: "", // 复电时间
          tripCause: "",
          voltageClasses: "",
          unitName: "",
          unitId: ""
        }];
      });
      this.dialogMarketingConfig.isShow = false;
    },
    // 设备部
    close() {
      this.getBack();
    },
    // 配电部
    close1() {
      this.getBack1();
    },
    // 营销部
    close2() {
      this.getBack2();
    },
    // 全部 - 集合 × 关闭按钮
    closeOf() {
      this.getBackOf();
    },
    // 分页
    handleSizeChange(val) {
      this.pageNum = val["current-page"];
      this.pageSize = val["page-size"];
      // this.list();
      this.query();
    },
    // 时间提示
    pickerChange(val, item, num) {
      console.log("打印111");
      this.$nextTick(() => {
        if (
          this.$refs.formConfigData.form.blackoutTime &&
          this.$refs.formConfigData.form.recoverTime
        ) {
          const start = +new Date(
            this.$refs.formConfigData.form.blackoutTime
          );
          const end = +new Date(this.$refs.formConfigData.form.recoverTime);
          if (num === 1) {
            if (start > end) {
              this.$message({
                message: "开始时间不能大于结束时间",
                type: "error"
              });
              this.$set(this.$refs.formConfigData.form, "blackoutTime", "");
            }
          } else {
            if (end < start) {
              this.$message({
                message: "结束时间不能小于开始时间",
                type: "error"
              });
              this.$set(this.$refs.formConfigData.form, "recoverTime", "");
            }
          }
        }
      });
    }
  }
};
</script>

<style scoped lang="less">
// @import '../../../assets/style/ComponentStyle.less';
@import "../../../assets/style/common.less";
@import "../../../assets/style/ComponentStyle.less";
@import "../../../assets/style/pop-upNotification.less";

:deep(.el-breadcrumb__inner.is-link) {
  font-weight: 100;
  color: #fff;
}

.EmergencyList :deep(.el-breadcrumb__item:last-child .el-breadcrumb__inner) {
  color: #3270ff;
}

.box {
  // width: 100%;
  // height: 80vh;
  // padding: 0;
  // margin: 0;
  margin-top: 20px;
  background-color: #fff;
  border-radius: 4px;
  padding: 10px;
  box-sizing: border-box;
}
</style>
